#!/usr/bin/python
# -*- coding: UTF-8 -*-

# Copyright (C) 2025 Huawei Technologies Co., Ltd. All rights reserved.

import os
import stat
from openubmc_ansible.utils import ansible_get_loger, BMC_LOG_PATH, BMC_REPORT_PATH, BASIC_PATH

if not os.path.exists(BASIC_PATH):
    os.makedirs(BASIC_PATH)
    os.chmod(BASIC_PATH, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP)

if not os.path.exists(BMC_LOG_PATH):
    os.makedirs(BMC_LOG_PATH)
    os.chmod(BMC_LOG_PATH, stat.S_IRWXU)
if not os.path.exists(BMC_REPORT_PATH):
    os.makedirs(BMC_REPORT_PATH)
    os.chmod(BMC_REPORT_PATH, stat.S_IRWXU)

LOG_FILE = "%s/ansiblebmc.log" % BMC_LOG_PATH
REPORT_FILE = "%s/ansiblebmc.report" % BMC_REPORT_PATH
log, report = ansible_get_loger(LOG_FILE, REPORT_FILE, "ansiblebmc")
